package com.itheima.homework.homework03;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class Demo3 {
    public static void main(String[] args) throws ParseException {
        String s = "2008-08-08";

        /*
           ----- 将字符串s转换为日期对象，并得到毫秒值.-----
         */
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = simpleDateFormat.parse(s);
        System.out.println(date);
        System.out.println("毫秒值为：" + date.getTime());
    }
}
